<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
</head>
<body>
    <div id="root">
        <span>a = {{number.a}}</span><br>
        <span>b = {{number.b}}</span><br>
    </div>
    <script>
        Vue.config.productionTip = false;
        let vm = new Vue({
            el: '#root',
            data: {
                number:{
                    a:100,
                    b:200,
                }
            },
            watch: {
                number:{
                    // 开启深度监视
                    deep:true,
                    handler(){
                        console.log("number变化了");
                    }
                }
            }
        });
    </script>
</body>
</html>